﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using MySkiPatrolEntity;

namespace MySkiPatrolEntity
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IEventManagement" in both code and config file together.
    [ServiceContract]
    public interface IEventManagement
    {
        [OperationContract]
        string Version();

        [OperationContract]
        EventCollection GetEvents(Event data);

        [OperationContract]
        EventCollection GetPublicEvents(Event data);

        [OperationContract]
        Event GetEvent(Event calendarEvent);

        [OperationContract]
        Event PutEvent(Event calendarEvent);
    }

    [DataContract]
    public class EventCollection
    {
        [DataMember]
        public DataTransaction DataTransaction { get; set; }

        [DataMember]
        public DateTimeOffset Current { get; set; }
        [DataMember]
        public DateTimeOffset NextMonth { get; set; }
        [DataMember]
        public DateTimeOffset PreviousMonth { get; set; }

        [DataMember]
        public List<Event> Events { get; set; }
    }

    [DataContract]
    public class Event
    {
        [DataMember]
        public DataTransaction DataTransaction { get; set; }

        [DataMember]
        public string ID { get; set; }
        [DataMember]
        public string OwnerID { get; set; }
        [DataMember]
        public string OwnerName { get; set; }
        [DataMember]
        public DateTimeOffset StartDate { get; set; }
        [DataMember]
        public DateTimeOffset EndDate { get; set; }
        [DataMember]
        public bool AllDayEvent { get; set; }
        [DataMember]
        public string Title { get; set; }
        [DataMember]
        public string Location { get; set; }
        [DataMember]
        public string Comments { get; set; }
        [DataMember]
        public string Action { get; set; }
        [DataMember]
        public bool IsPublic { get; set; }
        [DataMember]
        public bool EmailBroadcast { get; set; }
        [DataMember]
        public bool VisibleOnRibbon { get; set; }
        //[DataMember]
        //public int NumberOfSignupSlots { get; set; }
        //[DataMember]
        //public List<EventRecurrence> Occurrences { get; set; }

        public Event()
        {

        }
    }
}